package com.heima.user.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.user.dto.LoginDto;
import com.heima.user.service.IApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/login")
@Api(tags = "app用户登录")
public class LoginController {

    @Autowired
    private IApUserService apUserService;

    /**
     * app端登录
     * @param dto
     * @return
     */
    @PostMapping("login_auth")
    @ApiOperation(value = "login" ,notes = "app用户登录")
    @ApiModelProperty(name ="dto" ,dataType = "LoginDto" ,required = true)
    public ResponseResult login(@RequestBody  LoginDto dto){

        return apUserService.login(dto);
    }
}
